package com.zy;

import lombok.extern.slf4j.Slf4j;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.web.servlet.MultipartConfigFactory;
import org.springframework.context.annotation.Bean;
import org.springframework.transaction.annotation.EnableTransactionManagement;
import org.springframework.util.unit.DataSize;

import javax.servlet.MultipartConfigElement;

@SpringBootApplication
@Slf4j
@EnableTransactionManagement
public class ZyGraduationApplication {
    public static void main(String[] args) {
        SpringApplication.run(ZyGraduationApplication.class, args);
        log.info("server started");
    }
    @Bean
    public MultipartConfigElement multipartConfigElement() {
        MultipartConfigFactory factory = new MultipartConfigFactory();
        //指定文件大小
        factory.setMaxFileSize(DataSize.ofBytes(10000000000L));
        //设定上传文件大小
        factory.setMaxRequestSize(DataSize.ofBytes(10000000000L));
        return factory.createMultipartConfig();
    }
}
